package com.minkr.springboot.controller;

import com.minkr.springboot.domin.MyEvnProperties;
import com.minkr.springboot.service.impl.StudentServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class IndexController {
    private MyEvnProperties myEvnProperties;
    @Autowired
    public void setMyEvnProperties(MyEvnProperties myEvnProperties) {
        this.myEvnProperties = myEvnProperties;
    }

    private StudentServiceImpl service;
    @Autowired
    public void setService(StudentServiceImpl service) {
        this.service = service;
    }

    @RequestMapping(value = "/say",method = {RequestMethod.GET})
    public @ResponseBody String Say(){
        return "Hello,多环境下核心配置文件<br/>当前环境："+myEvnProperties.getName();
    }
}
